{% import '_macros.html' as macros %}
{% for book in paginate.items %}
    {% if loop.first %}
        <ul class="list-group">
    {% endif %}
<li class="list-group-item show_modal">
    <a href="javascript:;" data-toggle="modal" data-target="#modal-comment-book"
               data-url="{{ url_for('book_detail',book_id=book.id) }}">{{ book.name }}</a>
    <span class="badge pull-right">{{ book.comments|length }}</span>
    <a class="btn btn-xs pull-right opt_classify_del_book_a" data-toggle="modal"
       data-target="#modal-book_classify-del" data-url="{{ url_for('del_book',book_id=book.id) }}">删除</a>
    <a class="btn btn-xs pull-right opt_book_a" data-toggle="modal"
       data-target="#modal-book_add_or_update"
       data-book_id="{{ book.id }}"
       data-url="{{ url_for('opt_book_modal') }}"
    >修改</a>
</li>
{% if loop.last %}
    </ul>
    <div class="ajax-list-manage-book">
    {% if paginate.pages > 1 %}
        {{ macros.pagination_widget(paginate,'get_books_list',book_classify_id=book.book_classify_id) }}
    {% endif %}
    </div>
{% endif %}
{% endfor %}